import org.jxls.common.Context;
import org.jxls.transform.Transformer;
import org.jxls.util.JxlsHelper;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Main {

    public static void main(String[] args) throws Exception {

        Context context = new Context();

        Map item = new HashMap();
        item.put("rownum", "1");
        item.put("apply_com_id", "中文杀杀杀");

        Map item2 = new HashMap();
        item2.put("rownum", "2");
        item2.put("apply_com_id", "中文杀杀杀");

        Map item3 = new HashMap();
        item3.put("rownum", "3");
        item3.put("apply_com_id", "中文杀杀杀");

        List list = new ArrayList();
        list.add(item);
        list.add(item2);
        list.add(item3);

        context.putVar("items", list);

        JxlsHelper jxlsHelper = JxlsHelper.getInstance();
        Transformer transformer  = jxlsHelper.createTransformer(new FileInputStream("E:\\projects\\javaProject\\jxls-test\\src\\main\\resources\\test.xlsx"), new FileOutputStream("E:\\projects\\javaProject\\jxls-test\\src\\main\\resources\\out.xlsx"));
        jxlsHelper.processTemplate(context, transformer);
    }
}
